package com.tairanchina.wiki.api.model.wiki.content;

import com.tairanchina.wiki.api.TextBuilder;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by 周靖捷 on 2016/10/4.
 */
public class SimplePointListPageFragment extends AbstractPageFragment<SimplePointListPageFragment> {

    List<String> pointListContents = new ArrayList<String>();

    @Override
    public String getContent() {
        TextBuilder textBuilder = new TextBuilder();
        for (String point : pointListContents) {
            textBuilder.nextLine().indent().write("* ").write(point);
        }
        return textBuilder.build();
    }

    public List<String> getPointListContents() {
        return pointListContents;
    }

    public SimplePointListPageFragment setPointListContents(List<String> pointListContents) {
        this.pointListContents = pointListContents;
        return this;
    }

    public SimplePointListPageFragment addPointListContent(String content) {
        pointListContents.add(content);
        return this;
    }
}
